export type WxUserPermission = 'scope.address'
	| 'scope.invoice'
	| 'scope.invoiceTitle'
	| 'scope.userInfo'
	| 'scope.userLocation'
	| 'scope.userLocationBackground'
	| 'scope.record';

//定义某个微信api从哪个版本基础库开始支持
export enum WX_API_VERSION {
	getPrivacySetting = '2.32.2',//隐私协议
}

export interface BaseDetailRes<T> {
	detail : {
		errMsg : string,
	} & T,
}

//表单组件 change 回调类型
export interface WxFormChangeRes<T> {
	detail : {
		value : T
	}
}

export interface GetPrivacySettingRes {
	privacyContractName : string,//隐私协议名称
	needAuthorization : boolean,//是否需要用户阅读同意
}

export type GetPhoneNumberRes = BaseDetailRes<{
	code : string,
	encryptedData : string,
	iv : string,
}>;


export interface ScrollViewScrollRes {
	detail : {
		scrollTop : number,
		scrollHeight : number,
		deltaY : number
	}
}

export interface SelectorQueryRes {
	bottom : number,
	height : number,
	left : number,
	right : number,
	top : number,
	width : number,
}

//授权相关错误
export enum WX_AUTH_DENY_ERROR {
	saveImageToPhotosAlbum = 'saveImageToPhotosAlbum:fail auth deny',//没有保存到相册权限
	getLocation = 'getLocation:fail auth deny',//无获取位置授权错误信息
}

//api取消类错误信息
export enum WX_API_CANCEL_ERROR {
    chooseMideaCancel = 'chooseMedia:fail cancel',//选择媒体取消
}

//小程序版本
export enum MINI_ENV_VERSION {
	develop = 'develop', //开发版
	trial = 'trial', //体验版
	release = 'release' //正式
}


export interface WxShareRes<T> {
	from : string,
	target : {
		dataset : T
	}
}


export interface WxRecorderOnStopRes {
	duration : number,
	fileSize : number,
	tempFilePath,
}